package com.lzy.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.StringUtils;
import org.hibernate.annotations.GenericGenerator;

import com.lzy.util.DateUtil;

@Entity
@Table(name = "TBIMTask")
public class IMTask {

	@Id
	@GenericGenerator(name = "idGenerator", strategy = "native")
	@GeneratedValue(generator = "idGenerator")
	@Column(name="taskId",unique=true)
	private int taskId;

	@Column(name="taskName",length=64,nullable=false)
	private String taskName;
	
	@Column(name="createTime",nullable=false)
	private Date createTime;
	
	@Column(name="taskType",nullable=false)
	private int taskType;

	@Column(name="localId",length=64,nullable=false)
	private String localId;

	@Column(name="peerId",length=64,nullable=false)
	private String peerId;
	
	@Column(name = "execTime")
	private Date execTime;
	
	@Column(name = "outTime")
	private Date outTime;
	
	@Column(name = "status")
	private int status;
	
	@Column(name = "sendContent",length=4000)
	private String sendContent;
	
	@Column(name = "remark",length=4000)
	private String remark;
	
	@Column(name = "a1",length=64)
	private String a1;
	@Column(name = "a2",length=64)
	private String a2;
	@Column(name = "a3",length=4000)
	private String a3;
	
	public int getTaskId() {
		return taskId;
	}
	public void setTaskId(int taskId) {
		this.taskId = taskId;
	}
	public String getTaskName() {
		return taskName;
	}
	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}
	public String getCreateTime() {
		if(createTime != null){
			return DateUtil.date2String(this.createTime);
		}
		return StringUtils.EMPTY;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public int getTaskType() {
		return taskType;
	}
	public void setTaskType(int taskType) {
		this.taskType = taskType;
	}
	public String getLocalId() {
		return localId;
	}
	public void setLocalId(String localId) {
		this.localId = localId;
	}
	public String getPeerId() {
		return peerId;
	}
	public void setPeerId(String peerId) {
		this.peerId = peerId;
	}
	public String getExecTime() {
		if(execTime != null){
			return DateUtil.date2String(this.execTime);
		}
		return StringUtils.EMPTY;
	}
	public void setExecTime(Date execTime) {
		this.execTime = execTime;
	}
	public String getOutTime() {
		return DateUtil.date2String(this.outTime);
	}
	public void setOutTime(Date outTime) {
		this.outTime = outTime;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public String getSendContent() {
		return sendContent;
	}
	public void setSendContent(String sendContent) {
		this.sendContent = sendContent;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getA1() {
		return a1;
	}
	public void setA1(String a1) {
		this.a1 = a1;
	}
	public String getA2() {
		return a2;
	}
	public void setA2(String a2) {
		this.a2 = a2;
	}
	public String getA3() {
		return a3;
	}
	public void setA3(String a3) {
		this.a3 = a3;
	}
}
